﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;

namespace XMK.Framework.Model.Ajax
{
    /// <summary>
    /// Ajax方法交互的映射集合类，用户配置方法别名和实际方面名已经参数类型列表的映射
    /// </summary>
    [XmlRoot("AjaxMapping")]
    public class AjaxMappingInfo
    {
        /// <summary>
        /// 需要引用的命名空间
        /// </summary>
        [XmlAttribute("Assemblies")]
        public string Assemblies { get; set; }
        /// <summary>
        /// Ajax方法交互的映射类列表
        /// </summary>
        [XmlElement(ElementName = "BizMapping")]
        public List<BizMappingInfo> BizMappings { get; set; }
    }
    /// <summary>
    /// Ajax方法交互的映射类
    /// </summary>
    [Serializable]
    public class BizMappingInfo
    {
        /// <summary>
        /// 类名
        /// </summary>
        [XmlAttribute("Name")]
        public string Name { get; set; }
        /// <summary>
        /// AjaxMethodMappingInfo集合
        /// </summary>
        [XmlElement(ElementName = "MethodMapping")]
        public List<MethodMappingInfo> MethodMappings { get; set; }
    }
    /// <summary>
    /// Ajax方法交互的映射类，用户配置方法别名和实际方面名已经参数类型列表的映射
    /// </summary>
    [Serializable]
    public class MethodMappingInfo
    {
        /// <summary>
        /// 方法别名
        /// </summary>
        [XmlAttribute("Alias")]
        public string Alias { get; set; }
        /// <summary>
        /// 方法全名
        /// 规则：XMK.Xxxx.XxxxBusiness.xxxMthod，其中xxxMthod是真实的方法名，XxxxBusiness是方法所在的类名，XMK.Xxxx为方法所在的类的命名空间
        /// </summary>
        [XmlAttribute("MethodName")]
        public string MethodName { get; set; }
        /// <summary>
        /// 方法的参数列表
        /// </summary>
        [XmlAttribute("ParaTypes")]
        public string ParaTypes { get; set; }
    }
}